<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>文法学院学生党务工作自动回复系统</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
        }
        .container {
            width: 80%;
            margin: 50px auto;
            background: white;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        h1 {
            text-align: center;
            color: #333;
        }
        ul {
            list-style-type: none;
            padding: 0;
        }
        li {
            margin: 10px 0;
        }
        a {
            text-decoration: none;
            color: #007bff;
        }
        a:hover {
            text-decoration: underline;
        }
        .pagination {
            display: flex;
            justify-content: center;
            margin-top: 20px;
        }
        .pagination li {
            margin: 0 5px;
        }
        .pagination a {
            display: inline-block;
            padding: 5px 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
            text-decoration: none;
            color: #333;
        }
        .pagination a:hover {
            background-color: #eee;
        }
        .pagination .active a {
            background-color: #007bff;
            color: white;
            border-color: #007bff;
        }
        .pagination .disabled a {
            pointer-events: none;
            color: #ccc;
            border-color: #ddd;
        }
        .download-button {
            position: fixed;
            bottom: 20px;
            right: 20px;
            padding: 10px 20px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            text-decoration: none;
        }
        .download-button:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>文法学院学生党务工作自动回复系统</h1>
    <ul>
        <li th:each="entry : ${questions}">
            <a th:href="@{/answer(id=${entry.key})}" th:text="${entry.value}"></a>
        </li>
    </ul>
    <nav aria-label="Page navigation">
        <ul class="pagination">
            <li th:class="${currentPage == 1} ? 'disabled' : ''">
                <a class="page-link" th:href="@{/(page=${currentPage - 1})}" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
            <li th:each="i : ${#numbers.sequence(1, totalPages)}"
                th:class="${i == currentPage} ? 'active' : ''">
                <a class="page-link" th:href="@{/(page=${i})}" th:text="${i}"></a>
            </li>
            <li th:class="${currentPage == totalPages} ? 'disabled' : ''">
                <a class="page-link" th:href="@{/(page=${currentPage + 1})}" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        </ul>
    </nav>
</div>
<a href="/download" class="download-button">下载答案文件</a>
</body>
</html>